<?php
require_once './header.php';
require_once './core/sql.php';
$sql = new SqlS();


?>
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=0,maximum-scale=1.0"/>
        <title>课程</title>
        <link rel="stylesheet" href="./css/base.css">
        <link rel="stylesheet" href="./css/index.css">
        <script>
            function adapte() {//适配
                var designWidth = 1080, rem2px = 100;
                document.documentElement.style.fontSize = window.innerWidth / designWidth * rem2px + "px";
            }
            adapte();
        </script>
    </head>
    <body>
    <div class="course">
        <ul class="lists flex">
            <?php
            if (isset($_GET['id']) && isset($_SESSION['listArray'])) {
                $id = $_GET['id'];
                $list_array = $_SESSION['listArray'];
                $sql->courseWrite($id, $_SESSION['f-uid']);
            } else {
                ?>
                <script>
                    window.history.go(-1);
                </script>
                <?php
            }
            ?>
        </ul>
        <div class="btn">
            <button><a href="javascript:;" onclick="ajax_addCourses(<?= $_GET['id'] ?>)">提交</a>
            </button>
        </div>
    </div>
    <script src='./script/jquery.js'></script>
    <script src='./script/index.js'></script>
    <script></script>
    </body>
    </html>
<?php
require_once './footer.php';